package com.symone.webcms.schedule;

import com.symone.webcms.mapper.NotificationMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public abstract class BaseJob implements Job {

    @Autowired
    private NotificationMapper notificationMapper;

    protected int count = 1;

    protected Logger logger = LoggerFactory.getLogger(this.getClass());
    protected SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public void execute(JobExecutionContext context) {
        logger.info(simpleDateFormat.format(new Date()) + ":[ " + context.getJobDetail().toString() + " ]正在执行Job executing...");
    }


}
